<!DOCTYPE html>
<html>
<head>
    {include file="../application/common/header.html" /}
</head>

<body>
    <table id="study_advanced_clazz_chuerdg">
        <thead>
            <tr>
                {volist name="list" id="vo"}
                    <th data-options="field:'{$vo}'">{$vo}</th>
                {/volist}
            </tr>
        </thead>
    </table>
    <div id="study_advanced_clazz_chuertb">
        <form id="study_advanced_clazz_chuerForm" class="m5">
            <div>
                学期：
                <select class="easyui-combobox" id="termId" data-options="width:120,panelHeight:'auto',value:'请选择', editable:false,textField:'学期名称',valueField:'ID',url:'/compent/Util/termList',onSelect:changeTerm"></select>
                <select id="gradeId" class="easyui-combobox" data-options="width:80,panelHeight:'auto'">
                    <option value="2" selected>初二</option>
                </select>
                <select id="examId" name="examId" class="easyui-combobox" data-options="width:120,panelHeight:'auto',editable:false"></select>
                <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="queryOk('study_advanced_clazz_chuer')">查询</a>
                <a class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="zoutExcel()">导出为EXCEL</a>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        var url = "/examScore/study_advanced_clazz_chuer";
        $(function(){
            $("#study_advanced_clazz_chuerdg").datagrid({
                url: url + "/pageQuery.html",
                rownumbers:true,
                striped:true,
                border:false,
                pagination:true,
                pageSize:30,
                fitColumns:true,
                fit:true,
                toolbar: '#study_advanced_clazz_chuertb',
                rowStyler: function(index,row){
                    if(row.实验班==1){
                        return 'background-color:#fcc'
                    }else if(row.实验班==2){
                        return 'background-color:#9cf'
                    }else if(row.实验班==3){
                        return 'background-color:#ff9'
                    }
                }
            })
        })  
        function changeTerm(record){
            var gradeId = $('#gradeId').combobox('getValue');
            var url="/compent/util/getTermExam?termId="+record.ID+"&grade="+gradeId;
            $('#examId').combobox('setValue','');
            $('#examId').combobox('reload',url);
        }
        function queryOk(){
            var examId = $('#examId').combobox('getValue');
            var gradeId = $('#gradeId').combobox('getValue');
            if(examId){
                $('#study_advanced_clazz_chuerdg').datagrid('load',{examId:examId,gradeId:gradeId});
            }else{
                $.messager.alert('操作提示','请选择考试名称。');
            }
        }
        function zoutExcel() {
            var examId = $('#examId').combobox('getValue');
            var gradeId = $('#gradeId').combobox('getValue');
            if(examId){
                window.location.href = url+"/exportExcel.html?examId=" + examId + "&gradeId=" + gradeId;
            }else{
                $.messager.alert('操作提示','请选择考试名称。');
            }
            
        }
    </script>
</body>
</html>